package com.train.mgr.modules.biz.dto.response;

import lombok.Data;

import java.util.List;

@Data
public class AiAnalyzeResp {

    public int sample_rate;
    public double duration_sec_before_trim;
    public double duration_sec_after_trim;
    public double head_tail_trim_offset_sec;
    public List<LongPause> long_pauses;
    public int long_pause_count;
    public Disfluency disfluency;
    public double wer;
    public String wer_unit;
    public String wpm_unit;
    public double wpm_avg_overall;
    public double wpm_avg_voiced;
    public List<WpmTimelineItem> wpm_timeline;
    public double loudness_dbfs;
    public double loudness_dbfs_std;
    public double f0_mean_hz;
    public double f0_std_hz;
    public double f0_voiced_ratio;
    public DisfluencyMeanings disfluency_meanings;
    public List<FillerHit> fillers_hits;
    public List<DirectRepetitionHit> direct_repetition_hits;
    public List<PrefixRepetitionHit> prefix_repetition_hits;
    public List<NonFillerRepetitionHit> non_filler_repetition_hits;
    public List<SelfRepairsHit> self_repairs_hits;
    public String text_used_for_disfluency_and_wpm;

    private List<FillersCounts> fillers_counts;

    /* ---------------- 内部类 ---------------- */

    @Data
    public static class LongPause {
        public double start;
        public double end;
        public double duration;
    }

    @Data
    public static class Disfluency {
        public int fillers;
        public int repetition;
        public int self_repairs;
        public int total_disfluency_events;
    }

    @Data
    public static class WpmTimelineItem {
        public int minute_index;
        public double start_sec;
        public double end_sec;
        public double voiced_sec;
        public double wpm_est;
    }

    @Data
    public static class DisfluencyMeanings {
        public String fillers;
        public String direct_repetition;
        public String prefix_repetition;
        public String non_filler_repetition;
        public String self_repairs;
    }

    @Data
    public static class FillerHit {
        public String type;
        public String text;
        public String segment;
        public int start;
        public int end;
    }

    @Data
    public static class DirectRepetitionHit {
        public String type;
        public String segment;
        public String text;
        public int start;
        public int end;
    }

    @Data
    public static class PrefixRepetitionHit {
        public String type;
        public String segment;
        public String text;
        public int start;
        public int end;
    }

    @Data
    public static class NonFillerRepetitionHit {
        public String type;
        public String segment;
        public String text;
        public int start;
        public int end;
    }

    @Data
    public static class SelfRepairsHit {
        public String type;
        public String segment;
        public String text;
        public int start;
        public int end;
    }


    @Data
    public static class FillersCounts{
        public String filler;
        public int  count;
    }
}
